package com.xsz.lambdademo;

import java.util.function.Predicate;

public class PredicateDemo2 {

    public static void main(String[] args) {
         // 成绩是否大于60
        // Predicate<Double> isPass=(Double score)->{ boolean f=score>60  return f};
       // boolean test(T t);
        Predicate<Double> isPass=(Double score)->score>=60;

        System.out.println("59.3是否及格："+isPass.test(59.3));
        System.out.println("59.3是否及格："+isPass.test(89.3));


        //成绩小于60是 C

        //成绩80-90 是良好B

        //大于90 是A

        //判断是否优秀
        Predicate<Double> isA=(Double score)->score>90;
        isA.test(92d);
        //判断是否良好
        Predicate<Double> isB=(Double score)->score>80;
        isB.and((score) -> score < 90d).test(82d);
        //判断是否及格
        Predicate<Double> isC=(Double score)->score<60;
        isC.test(58d);

        Predicate<Double> isC2=isPass.negate();







    }
}
